package scf.demo.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;

@Data
@Schema(description = "付款申请明细参数")
public class PayApplyItem {

    @Schema(description = "付款申请编号", required = true)
    @NotBlank(message = "付款申请编号不能为空")
    private String applyNo;

    @Schema(description = "付款方式(产品code)；EC-化彩金；PT-化付保", required = true)
    @NotBlank(message = "产品Code不能为空")
    private String productCode;

    @Schema(description = "付款方名称", required = true)
    @NotBlank(message = "付款方名称不能为空")
    private String payCompName;

    @Schema(description = "付款方统一社会信用代码", required = true)
    @NotBlank(message = "统一社会信用代码不能为空")
    private String payUsccCode;

    @Schema(description = "付款方集团内部4位组织代码", required = true)
    @NotBlank(message = "付款方集团内部4位组织代码不能为空")
    private String payGroupInternalCode;

    @Schema(description = "支付方企业主数据编号", required = true)
    private String payGroupCustCode;

    @Schema(description = "收款方类型", required = true)
    @NotBlank(message = "收款方类型不能为空")
    private String recCustType;

    @Schema(description = "收款方名称", required = true)
    @NotBlank(message = "收款方名称不能为空")
    private String recCompName;

    @Schema(description = "收款方统一社会信用代码", required = true)
    @NotBlank(message = "收款方统一社会信用代码不能为空")
    private String recUsccCode;

    @Schema(description = "收款方集团内部4位组织编码")
    private String recGroupInternalCode;

    @Schema(description = "收款方客商主数据编号", required = true)
    @NotBlank(message = "客商主数据编号不能为空")
    private String recGroupCustCode;

    @Schema(description = "收款方是否内部单位", required = true)
    private Boolean isInternalRecUnit;

    @Schema(description = "付款金额", required = true)
    @NotNull(message = "付款金额不能为空")
    @DecimalMin(value = "0.01", message = "付款金额不能小于0.01")
    private BigDecimal amount;

    @Schema(description = "币种", required = true)
    @NotBlank(message = "币种不能为空")
    private String currencyType;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    @Schema(description = "申请到期日（化彩金/化付保业务的到期付款日）")
    @NotNull(message = "到期日不能为空")
    private LocalDate dueDate;

    @Schema(description = "付款备注")
    private String payRemark;

    @Schema(description = "影像barCode")
    private String barcode;
}
